package com.daoxiang.service.impl;

import com.daoxiang.dao.CityMapper;
import com.daoxiang.pojo.City;
import com.daoxiang.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class CityServiceImpl implements CityService {

    @Autowired
    private CityMapper cityMapper;

    @Override
    public City queryCityByCityId(String city) {
        return null;
    }

    @Override
    public List<City> queryAllCity() {
        return this.cityMapper.selectAll();
    }

    @Override
    public List<City> queryCityByProId(String proId) {
        Example example = new Example(City.class);
        Example.Criteria criteria = example.createCriteria();

        criteria.andEqualTo("proId", proId);
        return this.cityMapper.selectByExample(example);
    }
}
